<script setup>
import { useRouter } from 'vue-router'
import { ref } from 'vue';

const router = useRouter();
const myPath = ref('');
const fun = function() {
  // router.push(myPath.value)
  router.push({path: myPath.value})
}
</script>

<template>
  <div>
    <input v-bind:type="'button'" v-bind:value="'跳转到指定组件'" @click="fun()" />
    <input type="text" v-model="myPath" />

    <router-view></router-view>
  </div>
</template>

<style scoped>
</style>
